//
//  NCWindowStatus.m
//  NiceCommands
//
//  Created by James Tuley on 9/20/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "NCWindowStatus.h"


@implementation NCWindowStatus

@synthesize title,position,duration,playlist,playlistIndex;


- (id)initWithCoder:(NSCoder *)coder
{
	title = [[coder decodeObjectForKey:@"NCTitle"] retain];
	position =[coder decodeDoubleForKey:@"NCPosition"];
	duration  =[coder decodeDoubleForKey:@"NCDuration"];
	playlist  =[coder decodeObjectForKey:@"NCPlaylist"];
	playlistIndex  =[coder decodeIntForKey:@"NCPlaylistIndex"];


    return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
    if ( [coder isKindOfClass:[NSKeyedArchiver class]] ) {
		[coder encodeObject:title forKey:@"NCTitle"];
		[coder encodeDouble:position forKey:@"NCPosition"];
		[coder encodeDouble:duration forKey:@"NCDuration"];
		[coder encodeObject:playlist forKey:@"NCPlaylist"];
		[coder encodeInt:playlistIndex forKey:@"NCPlaylistIndex"];

    } else {
        [NSException raise:NSInvalidArchiveOperationException
                    format:@"Only supports NSKeyedArchiver coders"];
    }
}

@end
